import json
from noaa import NOAA
from trajectory import TarJectory
from draw import DRAW
with open('/root/Programs/NovaPrograms/set/_ads.json', 'r', encoding='utf-8') as file:  
    VALUE_SETS = json.load(file)

def main():
    #1.下载数据

    # noaa_obj = NOAA()
    # download_url:str = VALUE_SETS['NOAA_HYS_URL']+'gdas.202311/gdas1.nov23.w1'
    # noaa_obj._download_tar_gz(download_url)
    # download_url:str = VALUE_SETS['NOAA_HYS_URL']+'gdas.202311/gdas1.nov23.w2'
    # noaa_obj._download_tar_gz(download_url)
    # download_url:str = VALUE_SETS['NOAA_HYS_URL']+'gdas.202310/gdas1.oct23.w4'
    # noaa_obj._download_tar_gz(download_url)
    # download_url:str = VALUE_SETS['NOAA_HYS_URL']+'gdas.202310/gdas1.oct23.w5'
    # noaa_obj._download_tar_gz(download_url)

    #2.解压缩
    '''
    if file's type is '.w1',skip this step
    '''

    #     'month_range':(10,11),
    #3.计算后向轨迹
    tar_obj = TarJectory()
    # param:dict = {
    #     'year_range':[2023],
    #     'month_range':(10,11),
    #     'hour_range':(6, 15, 18, 21), 
    #     'height':[1000], 
    #     'site':(40.0, -90.0),
    #     'coordinates':-96
    # }
    # tar_obj._gen_back_traj(param)
    
    #tar_obj.parse_multi_file()

    #4.信息提取入库


    #5.绘制轨迹图
    draw_obj = DRAW()
    draw_obj.draw_traj_basemap(2.0,2)

if __name__ == "__main__":
    main()